<?php
	/**
	 * This is a MetaControl class, providing a QForm or QPanel access to event handlers
	 * and QControls to perform the Create, Edit, and Delete functionality
	 * of the TableCategory class.  This code-generated class
	 * contains all the basic elements to help a QPanel or QForm display an HTML form that can
	 * manipulate a single TableCategory object.
	 *
	 * To take advantage of some (or all) of these control objects, you
	 * must create a new QForm or QPanel which instantiates a TableCategoryMetaControl
	 * class.
	 *
	 * Any and all changes to this file will be overwritten with any subsequent
	 * code re-generation.
	 * 
	 * @package My Application
	 * @subpackage MetaControls
	 * property-read TableCategory $TableCategory the actual TableCategory data class being edited
	 * property QLabel $IdControl
	 * property-read QLabel $IdLabel
	 * property QIntegerTextBox $CategoryIdControl
	 * property-read QLabel $CategoryIdLabel
	 * property QIntegerTextBox $ParentCategoryIdControl
	 * property-read QLabel $ParentCategoryIdLabel
	 * property QTextBox $TitleEnControl
	 * property-read QLabel $TitleEnLabel
	 * property QTextBox $TitleJpControl
	 * property-read QLabel $TitleJpLabel
	 * property QTextBox $KeywordEnControl
	 * property-read QLabel $KeywordEnLabel
	 * property QTextBox $KeywordJpControl
	 * property-read QLabel $KeywordJpLabel
	 * property QTextBox $EnableControl
	 * property-read QLabel $EnableLabel
	 * property QDateTimePicker $RegisterDateControl
	 * property-read QLabel $RegisterDateLabel
	 * property QDateTimePicker $UpdateDateControl
	 * property-read QLabel $UpdateDateLabel
	 * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
	 * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
	 */

	class TableCategoryMetaControlGen extends QBaseClass {
		// General Variables
		protected $objTableCategory;
		protected $objParentObject;
		protected $strTitleVerb;
		protected $blnEditMode;

		// Controls that allow the editing of TableCategory's individual data fields
		protected $lblId;
		protected $txtCategoryId;
		protected $txtParentCategoryId;
		protected $txtTitleEn;
		protected $txtTitleJp;
		protected $txtKeywordEn;
		protected $txtKeywordJp;
		protected $txtEnable;
		protected $calRegisterDate;
		protected $calUpdateDate;

		// Controls that allow the viewing of TableCategory's individual data fields
		protected $lblCategoryId;
		protected $lblParentCategoryId;
		protected $lblTitleEn;
		protected $lblTitleJp;
		protected $lblKeywordEn;
		protected $lblKeywordJp;
		protected $lblEnable;
		protected $lblRegisterDate;
		protected $lblUpdateDate;

		// QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References

		// QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References


		/**
		 * Main constructor.  Constructor OR static create methods are designed to be called in either
		 * a parent QPanel or the main QForm when wanting to create a
		 * TableCategoryMetaControl to edit a single TableCategory object within the
		 * QPanel or QForm.
		 *
		 * This constructor takes in a single TableCategory object, while any of the static
		 * create methods below can be used to construct based off of individual PK ID(s).
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableCategoryMetaControl
		 * @param TableCategory $objTableCategory new or existing TableCategory object
		 */
		 public function __construct($objParentObject, TableCategory $objTableCategory) {
			// Setup Parent Object (e.g. QForm or QPanel which will be using this TableCategoryMetaControl)
			$this->objParentObject = $objParentObject;

			// Setup linked TableCategory object
			$this->objTableCategory = $objTableCategory;

			// Figure out if we're Editing or Creating New
			if ($this->objTableCategory->__Restored) {
				$this->strTitleVerb = QApplication::Translate('Edit');
				$this->blnEditMode = true;
			} else {
				$this->strTitleVerb = QApplication::Translate('Create');
				$this->blnEditMode = false;
			}
		 }

		/**
		 * Static Helper Method to Create using PK arguments
		 * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
		 * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
		 * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
		 * edit, or if we are also allowed to create a new one, etc.
		 * 
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableCategoryMetaControl
		 * @param integer $intId primary key value
		 * @param QMetaControlCreateType $intCreateType rules governing TableCategory object creation - defaults to CreateOrEdit
 		 * @return TableCategoryMetaControl
		 */
		public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			// Attempt to Load from PK Arguments
			if (strlen($intId)) {
				$objTableCategory = TableCategory::Load($intId);

				// TableCategory was found -- return it!
				if ($objTableCategory)
					return new TableCategoryMetaControl($objParentObject, $objTableCategory);

				// If CreateOnRecordNotFound not specified, throw an exception
				else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
					throw new QCallerException('Could not find a TableCategory object with PK arguments: ' . $intId);

			// If EditOnly is specified, throw an exception
			} else if ($intCreateType == QMetaControlCreateType::EditOnly)
				throw new QCallerException('No PK arguments specified');

			// If we are here, then we need to create a new record
			return new TableCategoryMetaControl($objParentObject, new TableCategory());
		}

		/**
		 * Static Helper Method to Create using PathInfo arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableCategoryMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableCategory object creation - defaults to CreateOrEdit
		 * @return TableCategoryMetaControl
		 */
		public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::PathInfo(0);
			return TableCategoryMetaControl::Create($objParentObject, $intId, $intCreateType);
		}

		/**
		 * Static Helper Method to Create using QueryString arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableCategoryMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableCategory object creation - defaults to CreateOrEdit
		 * @return TableCategoryMetaControl
		 */
		public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::QueryString('intId');
			return TableCategoryMetaControl::Create($objParentObject, $intId, $intCreateType);
		}



		///////////////////////////////////////////////
		// PUBLIC CREATE and REFRESH METHODS
		///////////////////////////////////////////////

		/**
		 * Create and setup QLabel lblId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblId_Create($strControlId = null) {
			$this->lblId = new QLabel($this->objParentObject, $strControlId);
			$this->lblId->Name = QApplication::Translate('Id');
			if ($this->blnEditMode)
				$this->lblId->Text = $this->objTableCategory->Id;
			else
				$this->lblId->Text = 'N/A';
			return $this->lblId;
		}

		/**
		 * Create and setup QIntegerTextBox txtCategoryId
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtCategoryId_Create($strControlId = null) {
			$this->txtCategoryId = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtCategoryId->Name = QApplication::Translate('Category Id');
			$this->txtCategoryId->Text = $this->objTableCategory->CategoryId;
			$this->txtCategoryId->Required = true;
			return $this->txtCategoryId;
		}

		/**
		 * Create and setup QLabel lblCategoryId
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblCategoryId_Create($strControlId = null, $strFormat = null) {
			$this->lblCategoryId = new QLabel($this->objParentObject, $strControlId);
			$this->lblCategoryId->Name = QApplication::Translate('Category Id');
			$this->lblCategoryId->Text = $this->objTableCategory->CategoryId;
			$this->lblCategoryId->Required = true;
			$this->lblCategoryId->Format = $strFormat;
			return $this->lblCategoryId;
		}

		/**
		 * Create and setup QIntegerTextBox txtParentCategoryId
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtParentCategoryId_Create($strControlId = null) {
			$this->txtParentCategoryId = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtParentCategoryId->Name = QApplication::Translate('Parent Category Id');
			$this->txtParentCategoryId->Text = $this->objTableCategory->ParentCategoryId;
			$this->txtParentCategoryId->Required = true;
			return $this->txtParentCategoryId;
		}

		/**
		 * Create and setup QLabel lblParentCategoryId
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblParentCategoryId_Create($strControlId = null, $strFormat = null) {
			$this->lblParentCategoryId = new QLabel($this->objParentObject, $strControlId);
			$this->lblParentCategoryId->Name = QApplication::Translate('Parent Category Id');
			$this->lblParentCategoryId->Text = $this->objTableCategory->ParentCategoryId;
			$this->lblParentCategoryId->Required = true;
			$this->lblParentCategoryId->Format = $strFormat;
			return $this->lblParentCategoryId;
		}

		/**
		 * Create and setup QTextBox txtTitleEn
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtTitleEn_Create($strControlId = null) {
			$this->txtTitleEn = new QTextBox($this->objParentObject, $strControlId);
			$this->txtTitleEn->Name = QApplication::Translate('Title En');
			$this->txtTitleEn->Text = $this->objTableCategory->TitleEn;
			$this->txtTitleEn->MaxLength = TableCategory::TitleEnMaxLength;
			return $this->txtTitleEn;
		}

		/**
		 * Create and setup QLabel lblTitleEn
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblTitleEn_Create($strControlId = null) {
			$this->lblTitleEn = new QLabel($this->objParentObject, $strControlId);
			$this->lblTitleEn->Name = QApplication::Translate('Title En');
			$this->lblTitleEn->Text = $this->objTableCategory->TitleEn;
			return $this->lblTitleEn;
		}

		/**
		 * Create and setup QTextBox txtTitleJp
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtTitleJp_Create($strControlId = null) {
			$this->txtTitleJp = new QTextBox($this->objParentObject, $strControlId);
			$this->txtTitleJp->Name = QApplication::Translate('Title Jp');
			$this->txtTitleJp->Text = $this->objTableCategory->TitleJp;
			$this->txtTitleJp->MaxLength = TableCategory::TitleJpMaxLength;
			return $this->txtTitleJp;
		}

		/**
		 * Create and setup QLabel lblTitleJp
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblTitleJp_Create($strControlId = null) {
			$this->lblTitleJp = new QLabel($this->objParentObject, $strControlId);
			$this->lblTitleJp->Name = QApplication::Translate('Title Jp');
			$this->lblTitleJp->Text = $this->objTableCategory->TitleJp;
			return $this->lblTitleJp;
		}

		/**
		 * Create and setup QTextBox txtKeywordEn
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtKeywordEn_Create($strControlId = null) {
			$this->txtKeywordEn = new QTextBox($this->objParentObject, $strControlId);
			$this->txtKeywordEn->Name = QApplication::Translate('Keyword En');
			$this->txtKeywordEn->Text = $this->objTableCategory->KeywordEn;
			$this->txtKeywordEn->MaxLength = TableCategory::KeywordEnMaxLength;
			return $this->txtKeywordEn;
		}

		/**
		 * Create and setup QLabel lblKeywordEn
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblKeywordEn_Create($strControlId = null) {
			$this->lblKeywordEn = new QLabel($this->objParentObject, $strControlId);
			$this->lblKeywordEn->Name = QApplication::Translate('Keyword En');
			$this->lblKeywordEn->Text = $this->objTableCategory->KeywordEn;
			return $this->lblKeywordEn;
		}

		/**
		 * Create and setup QTextBox txtKeywordJp
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtKeywordJp_Create($strControlId = null) {
			$this->txtKeywordJp = new QTextBox($this->objParentObject, $strControlId);
			$this->txtKeywordJp->Name = QApplication::Translate('Keyword Jp');
			$this->txtKeywordJp->Text = $this->objTableCategory->KeywordJp;
			$this->txtKeywordJp->MaxLength = TableCategory::KeywordJpMaxLength;
			return $this->txtKeywordJp;
		}

		/**
		 * Create and setup QLabel lblKeywordJp
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblKeywordJp_Create($strControlId = null) {
			$this->lblKeywordJp = new QLabel($this->objParentObject, $strControlId);
			$this->lblKeywordJp->Name = QApplication::Translate('Keyword Jp');
			$this->lblKeywordJp->Text = $this->objTableCategory->KeywordJp;
			return $this->lblKeywordJp;
		}

		/**
		 * Create and setup QTextBox txtEnable
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtEnable_Create($strControlId = null) {
			$this->txtEnable = new QTextBox($this->objParentObject, $strControlId);
			$this->txtEnable->Name = QApplication::Translate('Enable');
			$this->txtEnable->Text = $this->objTableCategory->Enable;
			$this->txtEnable->MaxLength = TableCategory::EnableMaxLength;
			return $this->txtEnable;
		}

		/**
		 * Create and setup QLabel lblEnable
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblEnable_Create($strControlId = null) {
			$this->lblEnable = new QLabel($this->objParentObject, $strControlId);
			$this->lblEnable->Name = QApplication::Translate('Enable');
			$this->lblEnable->Text = $this->objTableCategory->Enable;
			return $this->lblEnable;
		}

		/**
		 * Create and setup QDateTimePicker calRegisterDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calRegisterDate_Create($strControlId = null) {
			$this->calRegisterDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calRegisterDate->Name = QApplication::Translate('Register Date');
			$this->calRegisterDate->DateTime = $this->objTableCategory->RegisterDate;
			$this->calRegisterDate->DateTimePickerType = QDateTimePickerType::DateTime;
			$this->calRegisterDate->Required = true;
			return $this->calRegisterDate;
		}

		/**
		 * Create and setup QLabel lblRegisterDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblRegisterDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblRegisterDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblRegisterDate->Name = QApplication::Translate('Register Date');
			$this->strRegisterDateDateTimeFormat = $strDateTimeFormat;
			$this->lblRegisterDate->Text = sprintf($this->objTableCategory->RegisterDate) ? $this->objTableCategory->RegisterDate->__toString($this->strRegisterDateDateTimeFormat) : null;
			$this->lblRegisterDate->Required = true;
			return $this->lblRegisterDate;
		}

		protected $strRegisterDateDateTimeFormat;


		/**
		 * Create and setup QDateTimePicker calUpdateDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calUpdateDate_Create($strControlId = null) {
			$this->calUpdateDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calUpdateDate->Name = QApplication::Translate('Update Date');
			$this->calUpdateDate->DateTime = $this->objTableCategory->UpdateDate;
			$this->calUpdateDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calUpdateDate;
		}

		/**
		 * Create and setup QLabel lblUpdateDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblUpdateDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblUpdateDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblUpdateDate->Name = QApplication::Translate('Update Date');
			$this->strUpdateDateDateTimeFormat = $strDateTimeFormat;
			$this->lblUpdateDate->Text = sprintf($this->objTableCategory->UpdateDate) ? $this->objTableCategory->UpdateDate->__toString($this->strUpdateDateDateTimeFormat) : null;
			return $this->lblUpdateDate;
		}

		protected $strUpdateDateDateTimeFormat;




		/**
		 * Refresh this MetaControl with Data from the local TableCategory object.
		 * @param boolean $blnReload reload TableCategory from the database
		 * @return void
		 */
		public function Refresh($blnReload = false) {
			if ($blnReload)
				$this->objTableCategory->Reload();

			if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objTableCategory->Id;

			if ($this->txtCategoryId) $this->txtCategoryId->Text = $this->objTableCategory->CategoryId;
			if ($this->lblCategoryId) $this->lblCategoryId->Text = $this->objTableCategory->CategoryId;

			if ($this->txtParentCategoryId) $this->txtParentCategoryId->Text = $this->objTableCategory->ParentCategoryId;
			if ($this->lblParentCategoryId) $this->lblParentCategoryId->Text = $this->objTableCategory->ParentCategoryId;

			if ($this->txtTitleEn) $this->txtTitleEn->Text = $this->objTableCategory->TitleEn;
			if ($this->lblTitleEn) $this->lblTitleEn->Text = $this->objTableCategory->TitleEn;

			if ($this->txtTitleJp) $this->txtTitleJp->Text = $this->objTableCategory->TitleJp;
			if ($this->lblTitleJp) $this->lblTitleJp->Text = $this->objTableCategory->TitleJp;

			if ($this->txtKeywordEn) $this->txtKeywordEn->Text = $this->objTableCategory->KeywordEn;
			if ($this->lblKeywordEn) $this->lblKeywordEn->Text = $this->objTableCategory->KeywordEn;

			if ($this->txtKeywordJp) $this->txtKeywordJp->Text = $this->objTableCategory->KeywordJp;
			if ($this->lblKeywordJp) $this->lblKeywordJp->Text = $this->objTableCategory->KeywordJp;

			if ($this->txtEnable) $this->txtEnable->Text = $this->objTableCategory->Enable;
			if ($this->lblEnable) $this->lblEnable->Text = $this->objTableCategory->Enable;

			if ($this->calRegisterDate) $this->calRegisterDate->DateTime = $this->objTableCategory->RegisterDate;
			if ($this->lblRegisterDate) $this->lblRegisterDate->Text = sprintf($this->objTableCategory->RegisterDate) ? $this->objTableCategory->RegisterDate->__toString($this->strRegisterDateDateTimeFormat) : null;

			if ($this->calUpdateDate) $this->calUpdateDate->DateTime = $this->objTableCategory->UpdateDate;
			if ($this->lblUpdateDate) $this->lblUpdateDate->Text = sprintf($this->objTableCategory->UpdateDate) ? $this->objTableCategory->UpdateDate->__toString($this->strUpdateDateDateTimeFormat) : null;

		}



		///////////////////////////////////////////////
		// PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
		///////////////////////////////////////////////





		///////////////////////////////////////////////
		// PUBLIC TABLECATEGORY OBJECT MANIPULATORS
		///////////////////////////////////////////////

		/**
		 * This will save this object's TableCategory instance,
		 * updating only the fields which have had a control created for it.
		 */
		public function SaveTableCategory() {
			try {
				// Update any fields for controls that have been created
				if ($this->txtCategoryId) $this->objTableCategory->CategoryId = $this->txtCategoryId->Text;
				if ($this->txtParentCategoryId) $this->objTableCategory->ParentCategoryId = $this->txtParentCategoryId->Text;
				if ($this->txtTitleEn) $this->objTableCategory->TitleEn = $this->txtTitleEn->Text;
				if ($this->txtTitleJp) $this->objTableCategory->TitleJp = $this->txtTitleJp->Text;
				if ($this->txtKeywordEn) $this->objTableCategory->KeywordEn = $this->txtKeywordEn->Text;
				if ($this->txtKeywordJp) $this->objTableCategory->KeywordJp = $this->txtKeywordJp->Text;
				if ($this->txtEnable) $this->objTableCategory->Enable = $this->txtEnable->Text;
				if ($this->calRegisterDate) $this->objTableCategory->RegisterDate = $this->calRegisterDate->DateTime;
				if ($this->calUpdateDate) $this->objTableCategory->UpdateDate = $this->calUpdateDate->DateTime;

				// Update any UniqueReverseReferences (if any) for controls that have been created for it

				// Save the TableCategory object
				$this->objTableCategory->Save();

				// Finally, update any ManyToManyReferences (if any)
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * This will DELETE this object's TableCategory instance from the database.
		 * It will also unassociate itself from any ManyToManyReferences.
		 */
		public function DeleteTableCategory() {
			$this->objTableCategory->Delete();
		}		



		///////////////////////////////////////////////
		// PUBLIC GETTERS and SETTERS
		///////////////////////////////////////////////

		/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				// General MetaControlVariables
				case 'TableCategory': return $this->objTableCategory;
				case 'TitleVerb': return $this->strTitleVerb;
				case 'EditMode': return $this->blnEditMode;

				// Controls that point to TableCategory fields -- will be created dynamically if not yet created
				case 'IdControl':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'IdLabel':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'CategoryIdControl':
					if (!$this->txtCategoryId) return $this->txtCategoryId_Create();
					return $this->txtCategoryId;
				case 'CategoryIdLabel':
					if (!$this->lblCategoryId) return $this->lblCategoryId_Create();
					return $this->lblCategoryId;
				case 'ParentCategoryIdControl':
					if (!$this->txtParentCategoryId) return $this->txtParentCategoryId_Create();
					return $this->txtParentCategoryId;
				case 'ParentCategoryIdLabel':
					if (!$this->lblParentCategoryId) return $this->lblParentCategoryId_Create();
					return $this->lblParentCategoryId;
				case 'TitleEnControl':
					if (!$this->txtTitleEn) return $this->txtTitleEn_Create();
					return $this->txtTitleEn;
				case 'TitleEnLabel':
					if (!$this->lblTitleEn) return $this->lblTitleEn_Create();
					return $this->lblTitleEn;
				case 'TitleJpControl':
					if (!$this->txtTitleJp) return $this->txtTitleJp_Create();
					return $this->txtTitleJp;
				case 'TitleJpLabel':
					if (!$this->lblTitleJp) return $this->lblTitleJp_Create();
					return $this->lblTitleJp;
				case 'KeywordEnControl':
					if (!$this->txtKeywordEn) return $this->txtKeywordEn_Create();
					return $this->txtKeywordEn;
				case 'KeywordEnLabel':
					if (!$this->lblKeywordEn) return $this->lblKeywordEn_Create();
					return $this->lblKeywordEn;
				case 'KeywordJpControl':
					if (!$this->txtKeywordJp) return $this->txtKeywordJp_Create();
					return $this->txtKeywordJp;
				case 'KeywordJpLabel':
					if (!$this->lblKeywordJp) return $this->lblKeywordJp_Create();
					return $this->lblKeywordJp;
				case 'EnableControl':
					if (!$this->txtEnable) return $this->txtEnable_Create();
					return $this->txtEnable;
				case 'EnableLabel':
					if (!$this->lblEnable) return $this->lblEnable_Create();
					return $this->lblEnable;
				case 'RegisterDateControl':
					if (!$this->calRegisterDate) return $this->calRegisterDate_Create();
					return $this->calRegisterDate;
				case 'RegisterDateLabel':
					if (!$this->lblRegisterDate) return $this->lblRegisterDate_Create();
					return $this->lblRegisterDate;
				case 'UpdateDateControl':
					if (!$this->calUpdateDate) return $this->calUpdateDate_Create();
					return $this->calUpdateDate;
				case 'UpdateDateLabel':
					if (!$this->lblUpdateDate) return $this->lblUpdateDate_Create();
					return $this->lblUpdateDate;
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			try {
				switch ($strName) {
					// Controls that point to TableCategory fields
					case 'IdControl':
						return ($this->lblId = QType::Cast($mixValue, 'QControl'));
					case 'CategoryIdControl':
						return ($this->txtCategoryId = QType::Cast($mixValue, 'QControl'));
					case 'ParentCategoryIdControl':
						return ($this->txtParentCategoryId = QType::Cast($mixValue, 'QControl'));
					case 'TitleEnControl':
						return ($this->txtTitleEn = QType::Cast($mixValue, 'QControl'));
					case 'TitleJpControl':
						return ($this->txtTitleJp = QType::Cast($mixValue, 'QControl'));
					case 'KeywordEnControl':
						return ($this->txtKeywordEn = QType::Cast($mixValue, 'QControl'));
					case 'KeywordJpControl':
						return ($this->txtKeywordJp = QType::Cast($mixValue, 'QControl'));
					case 'EnableControl':
						return ($this->txtEnable = QType::Cast($mixValue, 'QControl'));
					case 'RegisterDateControl':
						return ($this->calRegisterDate = QType::Cast($mixValue, 'QControl'));
					case 'UpdateDateControl':
						return ($this->calUpdateDate = QType::Cast($mixValue, 'QControl'));
					default:
						return parent::__set($strName, $mixValue);
				}
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}
	}
?>